package com.dkx.springbootwebsocket.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author:     杜科璇
 * @Description:  TODO  
 * @Date:    2025/10/31 18:42
 * @Version:    1.0
 */
// Message.java
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Message implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String fromUser;
    private String toUser; // 可以是用户ID，群组ID，或者"all"表示广播
    private String content;
    private MessageType type;
    private Long timestamp;
    private Boolean isRead = false; // 是否已读

    public enum MessageType {
        P2P,      // 点对点
        GROUP,    // 群组
        BROADCAST // 广播
    }
}